home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Memphis Amiga Group / MAG DOS 2.0 Utilities Disk 10 (1992-08)(Memphis Amiga Group).zip / MAG DOS 2.0 Utilities Disk 10 (1992-08)(Memphis Amiga Group).adf / Enforcer / Enforcer.doc < prev    next >
Text File  |  1992-06-13  |  6KB  |  147 lines

  1.  
  2. ENFORCER
  3.  
  4. (C) Copyright 1991  Commodore-Amiga, Inc.  All Rights Reserved
  5.  
  6.  
  7. FUNCTION
  8.  
  9.     Enclosed is a majik tool for detecting invisible bugs in programs; _The
  10.     Enforcer_ uses the MMU to build a shroud of protection over anything
  11.     that is not legal memory.  Any "empty holes" in the address space are
  12.     marked as illegal by _Enforcer_.  Reads of the system ROMs are allowed,
  13.     but not writes.  With the exception of longword reads of location 4,
  14.     the lowest 1K of memory is completely off-limits.
  15.  
  16.     Enforcer runs on any Amiga or OS revision, as long a the MMU is not
  17.     already in use.  This version of Enforcer also works on the A3000 under
  18.     SuperKickstart (V1.3 or 2.0).  Under V1.3, enforcer requires SetPatch
  19.     version 1.38 or later.
  20.  
  21.  
  22.  
  23. SETUP
  24.     Connect a terminal or another Amiga to the serial port of your machine.
  25.     If you don't have an external terminal, just use a modem & terminal
  26.     software on the same machine.  Most modems simply echo back characters
  27.     when not on-line.  (alternately, you can use Enforcer.par which
  28.     outputs debugging information to the parallel port)
  29.  
  30.     Execute "enforcer". (or enforcer.par)
  31.  
  32.     Execute "lawbreaker" to verify that everything is working.  Lawbreaker
  33.     does two illegal memory references.
  34.  
  35.  
  36.  
  37. DESCRIPTION
  38.  
  39.     When an illegal access is detected, the power LED will flash and a
  40.     detailed message will be sent out the serial port (at the default
  41.     speed).  Illegal writes are aborted, illegal reads return NULL data.
  42.     For example:
  43.  
  44. Program Counter (approximate)= 783C460         Fault address        =DEADBEEF
  45. User stack pointer         = 7860ABC           DOS Proccess address = 7839F98
  46. Data: 00000001 01E0F0FB 00000FA0 0783AE18 00000001 01E0987F 01E0A93D 0783C3EC
  47. Addr: 0783AE18 0785FB28 07810114 0783C3EC 07860AC0 00F8F56A 00F8F55E 078021D0
  48. Status register =$8           Special status word =$729 (WRITE-WORD)
  49. Data output buffer  =$FFFFADEF (o)
  50. Process/CLI = Background CLI ,"lawbreaker"
  51. Hunk-O-Matic says: PC address is in hunk #0, near offset $70
  52.  
  53.  
  54.  
  55.     CLI command "lawbreaker" has written the word value $ADEF to location
  56.     $DEADBEEF.    The write was aborted.    With the information given, it is
  57.     usually quite easy to figure out what went wrong.
  58.  
  59.  
  60.  
  61. Remote keystrokes:
  62.         ^S    - pause.  You may have to press it more than once.
  63.         ^Q    - resume
  64.         ^X    - When in ^S, press ^X to suspend _Enforcer_ reporting.
  65.           Use ^Q to resume.
  66.  
  67.  
  68. Command line options:
  69.         on
  70.         fprotect    ;Same as on, but write protects $F00000-$F7FFFF
  71.         off
  72.  
  73.  
  74.  
  75.  
  76. Notes:
  77.  
  78.     Illegal hits from CLI commands named "metascope" or "wack" are ignored.
  79.  
  80.     Rebooting an A3000 running Enforcer causes the SuperKickstart to be
  81.     reloaded from scratch next time you boot.  Some call this a feature.
  82.     This will, however, kill RAD:.  When enforcer is off, SuperKickstart is
  83.     not reloaded.
  84.  
  85.     The Alert() system call writes to locations in the $180-$1C0 area.
  86.  
  87.  
  88.  
  89.  
  90. ---- Notes on the current version of Enforcer
  91.  
  92. 1. Hunk-o-matic can only output hunk offsets if your program
  93.    was started from a shell (ie. not from Workbench).
  94.  
  95. 2. The type of memory access (such as READ-WORD or READ-INSTR) is very
  96.    important for debugging.  READ-BYTE hits are generally a read of an
  97.    uninitialized string pointer.  READ-WORD and READ-LONG at low
  98.    addresses are generally references off an uninitialized structure
  99.    pointer.  WRITE hits of the same sizes are generally related
  100.    to the same types of uninitialized pointers.  In combination
  101.    with MungWall, similar hits at high addresses are generally
  102.    caused by accessing a string or structure after it has been
  103.    deallocated.  A READ-INSTR hit means your program counter
  104.    is trashed and your program is executing garbage.  This is
  105.    usually caused by using an invalid library base pointer or
  106.    by trashing a return address on your stack.  A READ-INSTR
  107.    hit at an address like $FFFFFFxx is genrally caused by an
  108.    uninitialized library base pointer (PC jumped to an LVO which
  109.    is a negative word offset, from a 0 base pointer).
  110.  
  111.    See mungwall.doc for additional information on the particular
  112.    nasty high values mungwall trashes free memory with.  This will
  113.    help you debug Mungwall+Enforcer hits.
  114.  
  115. 3. Some new information in the latest enforcer:
  116.  
  117.   (---)(-)(-)    SR=0008   SSW=0769   
  118.    I-n here means hit occurred within a level n interrupt 
  119.  
  120.   (---)(-)(-)    SR=0008   SSW=0769   
  121.         F here means it occurred in a Forbid
  122.  
  123.   (---)(-)(-)    SR=0008   SSW=0769   
  124.            D here means it occurred in a Disable
  125.  
  126.   (---)(-)(-)    SR=0008   SSW=0769   
  127.                  Additional processor status information
  128.  
  129. Sample enforcer hits:
  130.  
  131. Program Counter (approximate)=  396606        Fault address       =      14
  132. User stack pointer           =  439100        DOS process address =  35C380
  133. Data: DDDD0041 DDDD1100 DDDD2200 DDDD3300 DDDD4400 DDDD5500 DDDD6600 DDDD7700
  134. Addr: AAAA0000 AAAA1100 AAAA2200 AAAA3300 AAAA4400 AAAA5500 00001420 00002E28
  135. Stck: 00000009 00000008 00000007 00000006 00000005 00000004 00000003 00000002
  136. READ-WORD  (---)(F)(D)    SR=0015   SSW=0769   
  137. Background CLI, "lawbreaker", Hunk #0, Offset $96
  138.  
  139. Program Counter (approximate)=  396618        Fault address       =FEEDFACE
  140. User stack pointer           =  439100        DOS process address =  35C380
  141. Data: DDDD0041 DDDD1100 DDDD2200 DDDD3300 DDDD4400 DDDD5500 DDDD6600 DDDD7700
  142. Addr: AAAA0000 AAAA1100 AAAA2200 AAAA3300 AAAA4400 AAAA5500 00001420 00002E28
  143. Stck: 00000009 00000008 00000007 00000006 00000005 00000004 00000003 00000002
  144. WRITE-LONG  (---)(F)(-)    SR=0018   SSW=0709   Write Data= DDDD0041 (A)
  145. Background CLI, "lawbreaker", Hunk #0, Offset $A8
  146.  
  147.